<?
    /* -*- Mode: PHP5; tab-width: 4; indent-tabs-mode: nil; basic-offset: 4 -*- */
    
    /*********************************************************
    *            --== InArch ==--
    *
    *
    * @author Kulikov Alexey <a.kulikov@gmail.com>
    * @version n/a
    * @copyright essentialmind.com 2005
    *
    *********************************************************/

    /***
    * @author A Kulikov <a.kulikov@gmail.com>
    * @version n/a
    * @copyright essentialmind.com 2005
    ***/
    class shoppingCartItem{

        protected $properties = array();
        protected $aid;             // internal article id
        protected $price      = 0;  // price per adult ticket
        protected $price_d    = 0;  // price per child ticket
        protected $quant      = 0;  // adult tickets
        protected $quant2     = 0;  // child tickets

        function __construct($aid,$quant=1,$quant2=0,$price=0,$price_d=0){
            $this->price   = (float)$price;
            $this->price_d = (float)$price_d;
            $this->quant   = (int)$quant;
            $this->quant2  = (int)$quant2;
            $this->aid     = (int)$aid;
        }
        
        public function set($key,$value){
            $this->properties[$key] = $value;
        }
        
        public function get($key){
            return $this->properties[$key];
        }        
        
        public function price(){
            return $this->price1() * $this->quant() + $this->price2() * $this->quant2();
        }
        
        public function quant(){
            return $this->quant;
        }
        
        public function quant2(){
            return $this->quant2;
        }
        
        public function aid(){
            return $this->aid;
        }
        
        public function price1(){
            return $this->price;
        }
        
        public function price2(){
            return $this->price_d;
        }
    }        
?>